#include<bits/stdc++.h> 
using namespace std;
#define int long long
#define endl '\n'

void solve() {
	string s; cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] >= 'a' && s[i] <= 'z') s[i] -= 32;
	}
	if (s == "YES") cout << "YES" << endl;
	else cout << "NO" << endl;
}

signed main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int T; cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}